

define(function(require,exports,module){

		function Main(jqObj,loadParams){
	
		var columns = [[
			{field:'caseId',title:'主键ID',hidden:true},
			{field:'ajbh',title:'案件编号'},
			{field:'zgzdName',title:'主管中队'},
			{field:'zhdj',title:'灾害等级',width:60},
			{field:'zhdz',title:'灾害地址',width:260,align:'left'},
			{field:'bjsj',title:'报警时间',width:130},
			{field:'bjdh',title:'报警电话'},
			{field:'gpsLng',title:'经度'},
			{field:'gpsLat',title:'纬度'},
			{field:'zhpd',title:'灾害判定'},
			{field:'remark',title:'备注'}
		]];
		var formDialog = {
			title:'',
			height:1150,
			formEx:{
				url:'fire/firecaseinfo/save.do'
			}
		}
		var dateStr = $ui.date2Str(parseInt($('#server_info').attr('data-timestamp')));
		var MainUI = {
			eName:'datagrid',
			idField:'caseId',
			autoload:false,
			url:'fire/firecaseinfo/json.do',
			delUrl:'fire/firecaseinfo/del.do',
			columns:columns,
			toolbarEx:[{
				eName:'combobox',
				name:'zgzd',
				width:140,
				editable:false,
				valueField: 'orgUUID',
				textField: 'orgShortName',
				url:'sys/fireorg/json.do',
				AllFlag:true,
				panelHeight:400,
				queryParams:{orgType:4,pageSize:1000},
				onChange:function(newValue, oldValue){//combobox事件
					self.jqGrid.datagrid('load');
				}
			},{
				eName:'span',
				text:'报警日期:'
			},{
				eName:'datebox',
				name:'bjsj',
				width:100,
				value:dateStr,
				onSelect:function(){
					self.jqGrid.datagrid('load');
				}
			},{
				eName:'linkbutton',
				text:'修正日期',
				onClick:function(){
					var row = self.jqGrid.datagrid('getSelected');
					$ui.print(row);
					if(row == null){
						$ui.alert("选择要修正的记录?");
						return;
					}
					$ui.postEx("fire/firecaseinfo/copycase.do",{caseId:row.caseId,bjsj:row.bjsj},
						function(retJson){
							if(retJson.result) self.jqGrid.datagrid('reload');
						}
					);
				}
			}]
		}
		jqObj.createUI(MainUI);
		self.jqGrid = jqObj.findJq('datagrid');
		self.jqGrid.datagrid('load');
	}
	module.exports = Main;

});
